var http=require("http");
var fs=require("fs");
var path=require("path");
http.createServer((req,res)=>{
    //res.end("hello world");
    res.writeHead(200,{"Content-Type":"text/html"});
    var filePath=path.join(__dirname,"/image.jpg");
    var imgBuf=fs.readFileSync(filePath);
    var imgBase64=imgBuf.toString("base64");
    res.write("<!DOCTYPE html><html>"+"<head></head><body style='background:red;'>"+"<img src='data:image/jpg;base64,"+imageBase64+"'/>"+"</body></html>");
    res.end();
}).listen(8081);
console.log("server is listening 8081");